<template>
	<view class="" v-if="helpUser">
		<view class="topTitleBox" @click="isOpenChange">
			<view class="listTiteBox">
				<view class="listTitleBackground">
			
				</view>
				<view class="listTitle">
					基本信息
				</view>
			</view>
			<image src="/static/right.png" class="right" :class="isOpen?'rightOpen':''" mode=""></image>
		</view>
		<view class="childrenBox" :style="isOpen?'height:250rpx;':''">
			<view class="childrenOptionsBox">
				<view class="childrenOptionsTitle">申请人</view>
				<view class="childrenOptionsDes">{{helpUser.applicantName?helpUser.applicantName:'暂无'}}</view>
			</view>
			<view class="childrenOptionsBox">
				<view class="childrenOptionsTitle">地址</view>
				<view class="childrenOptionsDes">{{address?address:'暂无'}}</view>
			</view>
			<view class="childrenOptionsBox">
				<view class="childrenOptionsTitle">电话</view>
				<view class="childrenOptionsDes">{{helpUser.contactNumber?helpUser.contactNumber:'暂无'}}</view>
			</view>
		</view>
		<view class="line1"></view>
	</view>
</template>

<script>
	import province from '@/address/sheng.js'
	import city from '@/address/shi.js'
	import county from '@/address/qu.js'
	let sheng = {},shi={},qu={};
	province.forEach((item)=>{
		sheng[item.code+'0000'] = item.name
	})
	city.forEach((item)=>{
		shi[item.code+'00'] = item.name
	})
	county.forEach((item)=>{
		qu[item.code] = item.name
	})
	export default {
		props:{
			isOpenUserInfo:{
				type:Boolean,
				default:false
			}
		},
		data(){
			return {
				helpUser:"",
				sheng,shi,qu,
				address:"",
				isSave:0,
				isOpen:false
			}
		},
		mounted(){
			this.isSave = uni.getStorageSync('isSave')
			this.helpUser = uni.getStorageSync('helpUser')
			this.address = this.userInfoGetAddress()
			this.isOpen = this.isOpenUserInfo
		},
		methods:{
			userInfoGetAddress(){
				let residenceAddressCounty = this.helpUser.residenceAddressCounty?this.helpUser.residenceAddressCounty:''
				let residenceAddressStreet = this.helpUser.residenceAddressStreet?this.helpUser.residenceAddressStreet:''
				let residenceAddressCommunity = this.helpUser.residenceAddressCommunity?this.helpUser.residenceAddressCommunity:''
				return residenceAddressCounty+residenceAddressStreet+residenceAddressCommunity
			},
			// 基本信息开关
			isOpenChange(){
				this.isOpen = !this.isOpen
			}
		}
	}
</script>

<style scoped>
	.topTitleBox{
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 0 40rpx;
		height: 90rpx;
	}
	.listTiteBox {
		position: relative;
	}
	
	.listTitleBackground {
		height: 16rpx;
		width: 120rpx;
		position: absolute;
		bottom: 0;
		right: 0;
		background: linear-gradient(-90deg, #ffd356, #ffffff)
	}
	.listTitle{
		font-size:38rpx;
		position: relative;
	}
	.right {
		width: 34rpx;
		height: 34rpx;
		position: relative;
		transition: all 0.3s;
	}
	.childrenBox{
		width: 600rpx;
		margin: 0 auto;
		height: 0;
		position: relative;
		transition: all 0.3s;
		overflow: hidden;
	}
	.childrenOptionsBox{
		display: flex;
		align-items: flex-start;
		justify-content: space-between;
		padding: 20rpx 0;
	}
	.childrenOptionsTitle{
		font-size: 26rpx;
		line-height: 30rpx;
		color: #ccc;
	}
	.childrenOptionsDes{
		font-size: 26rpx;
		line-height: 30rpx;
		width: 450rpx;
		text-align: right;
	}
	.rightOpen{
		transform: rotate(90deg);
	}
	.line1{
		height: 20rpx;
		background-color: #efefef;
	}
</style>
